package fr.unice.client;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 * Defines an audio file like a MP3 for example.
 * 
 * @author PELLEGRINO Laurent
 * @author TROVATO Alexandre
 * 
 * @version 1.0
 */
@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class AudioFile implements Serializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;

	@Persistent
	private String name;

	@Persistent
	private String album;

	@Persistent
	private String artist;

	@Persistent
	private String year;

	@Persistent
	private String trackNumber;

	@Persistent
	private String genre;

	@Persistent
	private String duration;

	@Persistent
	private String uri;

	public AudioFile() {

	}

	/**
	 * @param name
	 * @param artist
	 * @param year
	 * @param trackNumber
	 * @param genre
	 * @param duration
	 */
	public AudioFile(String name, String artist, String album, String year,
			String trackNumber, String genre, String duration, String uri) {
		this.name = name;
		this.artist = artist;
		this.album = album;
		this.year = year;
		this.trackNumber = trackNumber;
		this.genre = genre;
		this.duration = duration;
		this.uri = uri;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return this.id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return the artist
	 */
	public String getArtist() {
		return this.artist;
	}

	/**
	 * 
	 * @return
	 */
	public String getAlbum() {
		return this.album;
	}

	/**
	 * @return the year
	 */
	public String getYear() {
		return this.year;
	}

	/**
	 * @return the trackNumber
	 */
	public String getTrackNumber() {
		return this.trackNumber;
	}

	/**
	 * @return the genre
	 */
	public String getGenre() {
		return this.genre;
	}

	/**
	 * @return the duration
	 */
	public String getDuration() {
		return this.duration;
	}

	/**
	 * 
	 * @return
	 */
	public String getURI() {
		return this.uri;
	}

	/**
	 * 
	 * @param id
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param artist
	 *            the artist to set
	 */
	public void setArtist(String artist) {
		this.artist = artist;
	}

	/**
	 * 
	 * @param album
	 */
	public void setAlbum(String album) {
		this.album = album;
	}

	/**
	 * @param year
	 *            the year to set
	 */
	public void setYear(String year) {
		this.year = year;
	}

	/**
	 * @param trackNumber
	 *            the trackNumber to set
	 */
	public void setTrackNumber(String trackNumber) {
		this.trackNumber = trackNumber;
	}

	/**
	 * @param genre
	 *            the genre to set
	 */
	public void setGenre(String genre) {
		this.genre = genre;
	}

	/**
	 * @param duration
	 *            the duration to set
	 */
	public void setDuration(String duration) {
		this.duration = duration;
	}

	/**
	 * 
	 * @param uri
	 */
	public void setURI(String uri) {
		this.uri = uri;
	}
}